/*Author: Felix Mendoza     */

var types = new Array();

types['Sports'] = new Array('Soccer 5v5', 'Soccer 11v11', 'Basket 5v5', 'Basket 3v3', 'Tennis', 'Rugby');
types['Traveling'] = new Array('Ski Trip', 'Mountain', 'Beach');
types['Entertainment'] = new Array('Movies', 'Theater', 'House Party', 'Pool Party');

function setType() {
  AmbitSel = document.getElementById('ambit');
  TypeList = types[AmbitSel.value];
  changeSelect('type', TypeList, TypeList);
}

function changeSelect(fieldID, newOptions, newValues) {
  selectField = document.getElementById(fieldID);
  selectField.options.length = 0;
  for (i=0; i<newOptions.length; i++) {
    selectField.options[selectField.length] = new Option(newOptions[i], newValues[i]);
  }
}

// Multiple onload function created by: Simon Willison
// http://simonwillison.net/2004/May/26/addLoadEvent/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}


